<div class="collections_header">Collections</div>

<div style="border-top: 1px solid #f6f6f6; border-bottom: 1px solid #f6f6f6" ng-init="updateCollectionCounts()">

    <div ng-repeat="collection in collectionList" ng-if="collection.count||collection.alwaysVisible">
        <div ng-class="{'collection_user_menu_row_selected':collection.name.toLowerCase()===selectedFolder}"
             ng-init="showAddCollection=false">

            <div class="collection-menu" ng-click='selectCollection(collection.name)'
                 ng-mouseenter="showAddCollection=selectedFolder===collection.name"
                 ng-mouseleave="showAddCollection=false">

                <span ng-show="collection.name!==selectedFolder">
                <i class="fa fa-fw" style="font-size: 16px; color: #d1d0d0;" ng-class="collection.icon"></i>
                    {{collection.display}}
                </span>

                <span ng-show="collection.name===selectedFolder">
                    <i class="fa fa-fw" style="font-size: 17px" ng-class="collection.iconOpen"></i>
                    <span style="font-weight: 600">{{collection.display}}</span>
                </span>

                <span class="menu_count">
                    <span ng-hide="showAddCollection">{{(collection.count | number) || 0}}</span>
                    <!--shown only for personal collection-->
                    <i ng-show="showAddCollection && collection.name==='personal'" ng-click="addCollectionIconClick()"
                       uib-tooltip="Add"
                       class="fa fa-fw fa-plus edit_icon" stop-event="click">
                    </i>

                    <i ng-show="showAddCollection" stop-event="click" class="opacity_hover fa fa-fw" ng-class="
                    {'fa-sort-alpha-asc': !sortParams.asc && sortParams.field=='folderName',
                    'fa-sort-alpha-desc': sortParams.asc && sortParams.field=='folderName',
                    'fa-sort-amount-asc': !sortParams.asc && sortParams.field=='creationTime',
                    'fa-sort-amount-desc': sortParams.asc && sortParams.field=='creationTime'}
                    " ng-click="sortCollectionFolders()"></i>
                </span>
            </div>

            <ice.menu.collections.details ng-if="selectedFolder===collection.name"></ice.menu.collections.details>
        </div>
    </div>
</div>
